package com.ccx.coachsite.ui.own;

import com.ccx.coachsite.R;
import com.ccx.coachsite.ui.CommonAppView;
import com.ccx.coachsite.ui.customview.LazyViewPager;
import com.ccx.coachsite.ui.customview.ViewPagerTab;

import android.content.Context;
import android.view.View;

public class ExpertMainView extends CommonAppView {

	public static final String TAG = "ExpertMainView";

	public LazyViewPager vp;
	public ViewPagerTab tab;

	private CommonAppView myExpertView;

	public ExpertMainView(Context context) {
		super(context);
		addView(R.layout.expert_viewpager);
		vp = (LazyViewPager) findViewById(R.id.pager);
		vp.addView(createMyExpertView());

		tab = (ViewPagerTab) findViewById(R.id.pagertab);
		tab.addTitle(new String[] { context.getResources().getString(
				R.string.expert_topic) });
		tab.setViewpager(vp);
		vp.setTab(tab);
	}

	private View createMyExpertView() {

		if (myExpertView != null)
			return myExpertView;
		myExpertView = new MyExpertView(this.getContext());
		return myExpertView;
	}
}
